(smtpmail-mail-address): New variable.
authorRichard M. Stallman <rms@gnu.org>
Sun, 12 May 2002 17:00:52 +0000 (17:00 +0000)
committerRichard M. Stallman <rms@gnu.org>
Sun, 12 May 2002 17:00:52 +0000 (17:00 +0000)
(smtpmail-send-it): Bind and use that instead of `mail-address'.
(smtpmail-via-smtp): Likewise.

lisp/mail/smtpmail.el

index 59bbd7fbc893fbf2dfe718b710daa2184eb6bb06..f43c5f1785865b971490f8959c7f155138c2d3a6 100644 (file)
@@ -211,6 +211,9 @@ This is relative to `smtpmail-queue-dir'.")
 ;;;
 ;;;
 
+(defvar smtpmail-mail-address nil
+  "Value of `user-mail-address' in ambient buffer.")
+
 ;;;###autoload
 (defun smtpmail-send-it ()
   (let ((errbuf (if mail-interactive
@@ -220,7 +223,7 @@ This is relative to `smtpmail-queue-dir'.")
        (case-fold-search nil)
        delimline
        (mailbuf (current-buffer))
-       (mail-address user-mail-address)
+       (smtpmail-mail-address user-mail-address)
        (smtpmail-code-conv-from
         (if enable-multibyte-characters
             (let ((sendmail-coding-system smtpmail-code-conv-from))
@@ -261,7 +264,7 @@ This is relative to `smtpmail-queue-dir'.")
            ;; they put one in themselves.
            (goto-char (point-min))
            (if (not (re-search-forward "^From:" delimline t))
-               (let* ((login mail-address)
+               (let* ((login smtpmail-mail-address)
                       (fullname (user-full-name)))
                  (cond ((eq mail-from-style 'angles)
                         (insert "From: " fullname)
@@ -686,7 +689,7 @@ This is relative to `smtpmail-queue-dir'.")
 ;            (smtpmail-send-command process (format "MAIL FROM:%s@%s" (user-login-name) (smtpmail-fqdn)))
              (smtpmail-send-command process (format "MAIL FROM: <%s>%s%s"
                                                     (or mail-envelope-from
-                                                        mail-address)
+                                                        smtpmail-mail-address)
                                                     size-part
                                                     body-part))